package com.javabase.y2022.m04.day0408.v2;

import java.util.Arrays;
import java.util.Comparator;

/**
 * @descriptions:
 * @author: Tom
 * @date: 2022/4/9 下午 04:05
 * @version: 1.0
 */
public class Code02 {
    public static class Program{
        public int start;
        public int end;
        public Program(int start, int end){
            this.start = start;
            this.end = end;
        }
    }
    public static class ProgramComparator implements Comparator<Program>{

        @Override
        public int compare(Program o1, Program o2) {
            return o1.end - o2.end;
        }
    }

    public static void main(String[] args) {
        Program p1 = new Program(0, 1);
        Program p2 = new Program(2, 3);
        Program[] pArr = new Program[]{p1, p2};
        for (int i = 0; i < pArr.length; i++) {
            System.out.println(pArr[i].start + "....." + pArr[i].end);
        }
    }

}
